/**************************
 * \if English
 * @Date:2018.09.10
 * @Author:
 * @Brief:
 * @Detail:
 * @Editor:
 * @Brief:
 * \else
 *
 * @创建日期：2018年9月10日
 * @作者：hualei
 * @大概功能：TCP_WRITE 指令
**************************/

#include "tcpwriteinstruction.h"

TcpWriteInstruction::TcpWriteInstruction()
{
    tcpWriteClientIPVec.resize(4);
    tcpWriteServerIPVec.resize(4);
}

//QDataStream& operator <<(QDataStream &out, TcpWriteInstruction &myVector)
//{
//    out << (quint32)myVector.instructionType << (quint32)myVector.tcpWriteType;

//    if(myVector.tcpWriteType == E_TCP_WRITE_TYPE_REGISTER)
//    {
//        out << myVector.tcpWriteRegBegAddress << myVector.regLengthValue;
//    }
//    else if(myVector.tcpWriteType == E_TCP_WRITE_TYPE_CONST)
//    {
//        out << myVector.tcpWriteConstValue;
//    }
//    out << myVector.tcpWriteIPVec;
//    out << myVector.tcpWritePort << myVector.jmpLBValue << myVector.noteStr;

//    return out;
//}

//QDataStream& operator >>(QDataStream &in, TcpWriteInstruction &myVector)
//{
//    quint32 instructionType;
//    quint32 writeType;

//    in >> instructionType >> writeType;
//    if(writeType == E_TCP_WRITE_TYPE_CONST)
//    {
//        in >> myVector.tcpWriteConstValue;
//    }
//    else if(writeType == E_TCP_WRITE_TYPE_REGISTER)
//    {
//        in >> myVector.tcpWriteRegBegAddress >> myVector.regLengthValue;
//    }
//    in >> myVector.tcpWriteIPVec;

//    in >> myVector.tcpWritePort >> myVector.jmpLBValue >> myVector.noteStr;
//    myVector.instructionType = (INSTRUCTION_TYPE)instructionType;
//    myVector.tcpWriteType = (EM_TCP_WRITE_TYPE)writeType;

//    return in;
//}
